# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-parsley
pkgname=('python2-parsley' 'python-parsley')
_pkgname=Parsley
pkgver=1.3
pkgrel=10
pkgdesc='Parsing and pattern matching made easy.'
arch=('any')
url='https://pypi.python.org/pypi/parsley/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/06/52/cac2f9e78c26cff8bb518bdb4f2b5a0c7058dec7a62087ed48fe87478ef0/$_pkgname-$pkgver.tar.gz")
sha512sums=('b87ebc44796e8511ad113f06d7bd4ebfec0161cfc8cd4d1db214da821ff61884328931ab39fdf34d33df5c9e803a1c3f5ac31e7ede176262f54b8b0a9cf3818b')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-parsley() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-parsley() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

